package org.dromara.exam.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.exam.domain.dto.AnswerExamInfo;
import org.dromara.exam.domain.entity.ExamAnswer;
import org.dromara.exam.domain.vo.ExamAnswerVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.exam.domain.vo.ExamProjectVo;

import java.util.Collection;
import java.util.List;

/**
 * 答题Mapper接口
 *
 * @author xiyin321
 * @date 2024-05-24
 */
public interface ExamAnswerMapper extends BaseMapperPlus<ExamAnswer, ExamAnswerVo> {

    int deleteBatchPaperIds(Collection<Long> ids);

    /*查询答卷列表*/
    Page<ExamAnswerVo> selectAnswerPage(@Param("page") Page<ExamAnswer> build,@Param(Constants.WRAPPER) Wrapper<ExamAnswer> examAnswerWrapper);

    /*修改答卷分数*/
    int updateScoreById(Long id, AnswerExamInfo examInfo, double score);

    /*根据项目ID进行修改完成状态*/
    void updateFinishByPaperId(Long id);

    List<ExamProjectVo> queryVoCounts(List<Long> ids);

}
